import React from "react";

class LikeButton extends React.Component
{
    constructor(props) {
        super(props);
        this.state ={liked: false}
    }

    handleClick(e) {
        this.setState({liked: !this.state.liked})
    }
    render() {
        const text = this.state.liked ? 'like' : 'do not like';
        return (
            <p onClick={this.handleClick.bind(this)}>
                you {text} this . click to toggle.
            </p>
        );
    }
}

export default LikeButton;
